<div id="admin-panel">
<?php
	$base = 'news';
	if ($table == 'graduate') {
		$base = 'graduates';
	} else if ($table == 'recruitnews') {
		$base = 'admissions';
	} else if ($table == 'course') {
		$base = 'courses';
	} else {
		$base = $table;
	}
?>
<h1>请使用编辑器进行编辑，<a target="_blank" href="<?=site_url('/'.$base.'/item/'.$news->NewsId)?>">查看本文</a></h1>
<?=form_open_multipart($action);?>
<input type="hidden" name="table" value="<?=$real_table?>" />
<input type="hidden" name="big_type" value="<?=$table?>" />
<input type="hidden" name="id" value="<?=$news->NewsId?>" />
<input type="hidden" name="backurl" value="<?=current_url()?>" />
<h2>标题：<input class="ep-title"type="text" size="50" name="title" value="<?=$news->Title?>" /></h2>
<h2>日期：<input class="bigbig"type="text" size="15" name="date" value="<?=$news->NewsDate?>" />
作者：<input class="bigbig"type="text" size="10" name="author" value="<?=$news->Author?>" /></h2>
<h2>主题图片：<input class="bigbig"type="text" id="imgfile" size="30" name="imgfile" value="<?=$news->ImgDir?>" />
<span style="color:red;">点击下面按钮上传图片</span></h2>
<div id="img-uploader"></div>
<?php if (count($available_types) > 0):?>
<h2>类型：<?php foreach($available_types as $a_type):?>
	<input class="bigbig" type="radio" name="type" value="<?=$a_type?>" <?=($a_type==$type) ? 'checked="checked"' : '' ?>/><?=$a_type?>
	<?php endforeach;?>
</h2>
<?php endif;?>
<h2>附件：</h2>
<?php foreach($appendix as $att):?>	
<p><a title="<?=$att->AppName?>" href="<?=base_url("/upload/attachments/$att->AppRealName")?>"><?=$att->AppName?></a>
<input type="checkbox" name="delete_atts[]" value="<?=$att->AppId?>" />选中删除</p>
<?php endforeach;?>
<div id="file-uploader">		
	<noscript>			
		<p>Please enable JavaScript to use file uploader.</p>
		<!-- or put a simple form for upload here -->
	</noscript>         
</div>
<div id="att-list"></div>
<script>        
	function createUploader(){            
		var uploader = new qq.FileUploader({
			element: document.getElementById('file-uploader'),
			action: '/upload.php',
			onComplete: function(id, fileName, responseJSON){
				document.getElementById('att-list').innerHTML = document.getElementById('att-list').innerHTML + '<input type="hidden" name="atts[]" value="'+fileName+'"/>';
			},
			sizeLimit: 2048000,
			debug: false
		}); 
		var uploader = new qq.FileUploader({
			element: document.getElementById('img-uploader'),
			action: '/upload.php',
			allowedExtensions: ['jpg', 'jpeg', 'png', 'gif', 'bmp'], 
			onComplete: function(id, fileName, responseJSON){
				document.getElementById('imgfile').value = fileName;
			},
			sizeLimit: 2048000,
			debug: false
		});
	}
	
	// in your app create uploader as soon as the DOM is ready
	// don't wait for the window to load  
	window.onload = createUploader();     
</script> 
<script type="text/plain" id="myEditor" class="myEditor">
<?=$news->Detail?>
</script>
<script type="text/javascript">
    var editor = new baidu.editor.ui.Editor();
    editor.render('myEditor');
</script>
<input id="subbt" type="submit" value="提交" />
</form>

 


</div>